package com.umeox.watch.httpclient.core.client;


import com.umeox.watch.httpclient.core.ApiCallback;
import com.umeox.watch.httpclient.core.ApiRequest;
import com.umeox.watch.httpclient.core.ApiResponse;
import com.umeox.watch.httpclient.core.constant.Scheme;
import com.umeox.watch.httpclient.core.exception.SdkException;

import java.util.List;

import okhttp3.Interceptor;

public abstract class BaseApiClient {
    Scheme scheme;
    String host;
    List<Interceptor> interceptors;
    boolean isInit = false;

    public BaseApiClient() {
    }

    protected void checkIsInit() {
        if (!this.isInit) {
            throw new SdkException("MUST initial client before using");
        }
    }

    protected abstract ApiResponse sendSyncRequest(ApiRequest request);

    protected abstract void sendAsyncRequest(ApiRequest request, ApiCallback callback);

}
